﻿using CommonData;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class app : MonoBehaviour {
    private static BaseNetTcp tcp;
    public static class AppPersistentPath
    {// 持久化路径
        public static string getScriptPath()//lua脚本路径
        {
            return Application.streamingAssetsPath + "/scripts";
        }
        public static string getPbcPath()//pbc路径
        {
            return Application.streamingAssetsPath + "/pbc";
        }
    }
    public static void send(byte[] data) {
        tcp.send(data);
    }
    private void Awake()
    {
        LuaHelper.LoadScript.load();
        tcp = new BaseNetTcp();
        tcp.initTcp("127.0.0.1", 8000, new RecvClass());
    }
    void Start () {
        FBLuaDebugger.enableDebug();
    }
    void OnDestroy() {
        tcp.cloes();
        Debug.Log("客户端关闭");
    }
    void Update () {
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
        if (Input.GetKeyDown(KeyCode.F2) == true)
        {
            FBLuaDebugger.showConsole();
        }
#endif
        LuaHelper.getLuaModule().callScript("update");
    }
}




